<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  </head>
  <body>
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'north',border:false,split:false" style="overflow:hidden">        
        <form id="query-form2" class="search_form clearfix">
        	<dl>
				<dt>社区名称：</dt>
				<dd>
					<input name="userName" id="name" type="text" class="txt" maxlength="32"/>
				</dd>
			</dl>
            <p class="search_form_btn">
            	<input type="button" value="搜索" class="icon_serach" onclick="query()" /></p>
        </form>
    </div>    
	<div data-options="region:'center',border:false">
  		<table id="datagrid2">
			<thead>
				<tr>
					<th data-options="field:'name',width:130,align:'center'">社区名称</th>
					<th data-options="field:'address',width:250,align:'center' ">社区地址</th>
					<th data-options="field:'creatorNick',width:80,align:'center' ">创建者</th>
					<th data-options="field:'status',width:80,align:'center',formatter:formatStatus">状态</th>
				</tr>
			</thead>
		</table>
    </div>    
</div>
<script type="text/javascript">
	easyui.util.initDatagrid('#datagrid2',{
		singleSelect:false,
		url:'${pageContext.request.contextPath}/community/base/choose'
	});
	
	function query() {
		if(!$('#query-form2').form('validate')) return;
		var data=$('#query-form2').form('jsonObject');
		$('#datagrid2').datagrid('load',data);
		//if(datagrid=='datagrid') $('#query-dialog').dialog('close');
	}
	
	function formatStatus (value,row,index) {
		if (value == 1) {
			return "待确认";
		} else if (value == 2) {
			return "已确认";
		} else if (value == 9) {
			return "已失效";
		}
	}
</script>
  </body>
</html>